<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../js/vue.js"></script>
</head>

<body>
    <div id="root">
        <h2 :style="{opacity}">Vue太简单啦</h2>
    </div>
    <script>
        Vue.config.productionTip = false //取消生产提示

        const vm = new Vue({
            el: '#root',
            data() {
                return {
                    opacity: 1
                }
            },
            mounted() {
                setInterval(() => {
                    this.opacity -= 0.01
                    if (this.opacity <= 0) {
                        this.opacity = 1
                    }
                }, 15);
            },

        })
    </script>
</body>

</html>